#_*_ coding: utf-8
"""
author: ning.luo
create_date: 2020/06/03
last_update: 2020/06/03
"""

import requests
import random
import string

class afterSaleLabelDetail():
    '''标签详细信息接口'''

    def __init__(self):
        self.base_url = "http://test-api.intra.casstime.com/label-service"
        self.headers = {'Content-Type': 'application/json'}

    def label_info_inquire(self, **body):
        '''根据前10位，后8位，16位编码查询标签详细信息'''
        url = self.base_url + "/label/detail"
        response = requests.get(url, body, headers=self.headers)
        assert response.status_code == 200, "状态码错误：%s，结果：%s" % (response.status_code, response.text)
        print(response.text)
        print("查询成功！")

if __name__ == "__main__":

    asld = afterSaleLabelDetail()

    # 标签详细信息查询接口
    label_code = random.choice(string.ascii_letters) + random.choice(string.ascii_letters) + str()
    print(label_code)
    print(random.sample(0,9,6))
    params_labelInfo = {"code":"AD300000"}
    asld.label_info_inquire(**params_labelInfo)